Closed Bug 1673913 Opened 5 years ago Closed 4 years ago

ContentIterator.cpp: do not use 'else' after 'return'

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: mccr8, Assigned: rafbiels)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=C++])

Attachments

(1 file, 5 obsolete files)

+++ This bug was initially created as a clone of Bug #1669833 +++

Filling as a good first bug to learn workflows.

do not use 'else' after 'return':
https://searchfox.org/mozilla-central/source/dom/base/ContentIterator.cpp#267-269

As the change is trivial, it is just to learn how to contribute to Firefox.

Found by http://clang.llvm.org/extra/clang-tidy/checks/readability-else-after-return.html

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

See Also: → 1669833

Working on it .

Assignee: nobody → namandude1008
Status: NEW → ASSIGNED

Submitted the patch , Please review .

I have a build error after removing the else statement as a variable lastNode used in else statement is declared in if (<variable declaration> ; ) . So i have to resubmit my patch . How to do that with hg commit --amend ? A nano editor is opened . Please help ?

Attachment #9184455 - Attachment description: Bug 1673913 - [core] Remove 'else' after 'return' dom/base/ContentIterator.cpp. r=mccr8 → Bug 1673913 - [core] Remove 'else' after 'return' variable declaration outside if statement dom/base/ContentIterator.cpp. r=mccr8

I already have an accepted patch since last week, it just wasn't landed yet and there was a little mix-up with bug reports, which is why this was opened as a clone of Bug 1669833

(In reply to Rafal Bielski from comment #6)

I already have an accepted patch since last week, it just wasn't landed yet and there was a little mix-up with bug reports, which is why this was opened as a clone of Bug 1669833

okay Great !!

Component: General → DOM: Core & HTML
Assignee: namandude1008 → rafbiels

Is your patch ready to land? I can land it for you.

Flags: needinfo?(rafbiels)

(In reply to Andrew McCreight [:mccr8] from comment #8)

Is your patch ready to land? I can land it for you.

Yes, please, I believe it is ready to land.

Flags: needinfo?(rafbiels)
See Also: → 1658273
Severity: -- → S4

(In reply to Rafal Bielski from comment #9)

(In reply to Andrew McCreight [:mccr8] from comment #8)

Is your patch ready to land? I can land it for you.

Yes, please, I believe it is ready to land.

Correction - let's wait until we agree the course of action with Mirko.

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: rafbiels → nobody
Status: ASSIGNED → NEW

Hey, what's the status on this bug?
I would like to work on this if possible

There was a patch ready (https://phabricator.services.mozilla.com/D94243) but it was stopped by Bug 1658273 where the conclusion was that this is in fact not a bug and should not be reported as one. It was agreed the corresponding clang-tidy setting will be changed after migration to clang 11.

is this issue still open to work on? because I see an accepted patch already.

(In reply to Sneha k from comment #14)

is this issue still open to work on? because I see an accepted patch already.

The patches attached to this ticket haven't landed. One of them was accepted, which is different.

Hi, can I work on this bug?

Hey there, I am new to open source and I am willing to contribute to Mozilla. I think I can fix this bug. Once the build process is complete, how do I write my first patch ? And where to go next ?
Please help me out on this .

I have removed the bug . So can I submit the patch ?

Assignee: nobody → surajeet310
Status: NEW → ASSIGNED
Attachment #9223508 - Attachment is obsolete: true
Attachment #9223516 - Attachment is obsolete: true
Attachment #9223531 - Attachment is obsolete: true
Attachment #9223531 - Attachment is obsolete: false
Attachment #9223508 - Attachment is obsolete: false
Attachment #9223531 - Attachment is obsolete: true
Attachment #9223508 - Attachment is obsolete: true
Attachment #9223571 - Attachment description: Bug 1673913 Replaced else branch with the statement within it and resolved the error:use of undeclared identifier 'lastNode' in ContentIterator.cpp .r=mccr8 and sylvestre → Bug 1673913 - Replaced else branch with the statement within it and resolved the error:use of undeclared identifier 'lastNode' in ContentIterator.cpp r=mccr8,sylvestre
Attachment #9223571 - Attachment description: Bug 1673913 - Replaced else branch with the statement within it and resolved the error:use of undeclared identifier 'lastNode' in ContentIterator.cpp r=mccr8,sylvestre → Bug 1673913 - Removed 'else' after 'return' to simplify code in ContentIterator.cpp r=mccr8,sylvestre

Rafal, it looks like the linked Clang tidy bug has been fixed, so your patch could be updated to remove the lastNode changes.

Rafal already wrote a patch, so there's no need for somebody else to fix this.

Assignee: surajeet310 → rafbiels
Flags: needinfo?(rafbiels)
Attachment #9184455 - Attachment is obsolete: true
Attachment #9223571 - Attachment is obsolete: true

Sorry everybody for the confusing state in this bug. As discussed in bug 1658273 it was decided that the lastNode part of this change is not wanted. Rafal's patch has fixes for the rest of the "else after return" issues in the function (while the rest of the patches in this bug do not), so hopefully they'll be able to update the patch and it can be landed.

Attachment #9184460 - Attachment description: Bug 1673913 - Fix readability-else-after-return warnings. r?masayuki → Bug 1673913 - Fix readability-else-after-return warnings. r?mbrodesser
Flags: needinfo?(rafbiels)

Andrew, may I ask you to assist with landing the patch?

Flags: needinfo?(continuation)

I've started the landing process. Thanks for your patience.

Flags: needinfo?(continuation)
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/24b8347681a5 Fix readability-else-after-return warnings. r=masayuki,mbrodesser
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: